//
//  Hello_OCUnitUITests.m
//  Hello_OCUnitUITests
//
//  Created by zhudongxia on 15/12/7.
//  Copyright © 2015年 zhudongxia. All rights reserved.
//

#import <XCTest/XCTest.h>

@interface Hello_OCUnitUITests : XCTestCase
{
    XCUIApplication *app;
}
@end

@implementation Hello_OCUnitUITests

- (void)setUp {
    [super setUp];
//    self.continueAfterFailure = NO;
    app = [[XCUIApplication alloc] init];
    [app launch];
}



#pragma  mark 测试 增加按钮点击事件
-(void) testPlusButtonTapTarget
{
    // buttons[@""] 字符串里面可以是button的title 也可以是accessibilityIdentifier
    [app.buttons[@"plus"] tap];
    sleep(5);
}

#pragma  mark 测试 nameTextField 输入数据
-(void) testNameTextField
{
    // 先让textfield 获得焦点
    [app.textFields[@"name"] tap];
    // 模拟输入数据
    [app.textFields[@"name"] typeText:@"234234"];
    sleep(5);
    
    
    
}


#pragma  mark 测试 清除按钮
-(void) testClearButton
{
    [app.buttons[@"clear"] tap];
    sleep(5);
}

























- (void)tearDown {
   
    [super tearDown];
//    [app terminate];
}


@end
